<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>开发者工作台-商品管理</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 0;
            background-color: #f4f4f4;
        }

        h3, p {
            text-align: center;
        }

        table {
            width: 80%;
            margin: 20px auto;
            border-collapse: collapse;
        }

        th, td {
            padding: 10px;
            border: 1px solid #ddd;
        }

        th {
            background-color: #f2f2f2;
        }

        form {
            margin: 10px auto;
            text-align: center;
        }

        label, input, select {
            margin-bottom: 10px;
        }

        input[type="text"],  input[type="radio"] {
            padding: 8px;
            font-size: 14px;

        }
        input[type="submit"]{
            padding: 8px 16px;
            background-color: #27ba9b;
            color: #fff;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }
        hr {
            margin: 20px auto;
        }
    </style>
</head>

<body>

<p style="text-align: center;font-size: 20px">商品信息管理</p>
<table style="text-align: center">
    <tr>
        <td>商品编号</td><td>商品名称</td><td>商品介绍</td><td>商品价格</td><td>商品类别</td><td>商品销售量</td><td>商品产地</td><td>商家编号</td><td>商家名称</td><td>商品质量</td>
    </tr>
</table>
<form id="goodTable" method="get">
    <input type="text" name="gid" value="<%=g.getGid()%>">
    <input type="text" name="gname" value="<%=g.getGname()%>">
    <input type="text" name="intro" value="<%=g.getIntro()%>">
    <input type="text" name="price" value="<%=g.getPrice()%>">
    <input type="text" name="type" value="<%=g.getType()%>">
    <input type="submit" id="update_good" value="修改"><br>
    <input type="text" name="sales" value="<%=g.getSales()%>">
    <input type="text" name="good_from" value="<%=g.getGood_from()%>">
    <input type="text" name="mid" value="<%=g.getMid()%>">
    <input type="text" name="mname" value="<%=g.getMname()%>">
    <input type="text" name="weight" value="<%=g.getWeight()%>">
    <input type="submit" id="delete_good" value="删除">
</form>



<h3 style="text-align: center">商品信息查询</h3>

<form id="selectTable" method="get">
    <input type="hidden" name="personAffected" value="good">
    <label for="all">查询全部商品:</label>
    <input type="submit" id="all" value="查询">
    <br>
    <label>按照商品id查询:</label>
    <input type="text" name="gid"><input type="submit" id="by_gid" value="查询">
    <br>
    <label>根据商品名称关键字查询:</label>
    <input type="text" name="gname"><input type="submit" id="like_name" value="查询">
    <br>
    <!-- 单选按钮 -->
    <label>按照商品类别查询:</label>
    <input type="text" name="type"><input type="submit" id="by_type" value="查询">
    <br>
    <label>根据产地关键字查询:</label>
    <input type="text" name="good_from"><input type="submit" id="like_goodFrom" value="查询">
    <br>
    <label>根据商家id查询:</label>
    <input type="text" name="mid"><input type="submit" id="by_mid" value="查询">
    <br>
    <label>按照商家名称查询:</label>
    <input type="text" name="mname"><input type="submit" id="by_mname" value="查询">
    <br>
    <label>按照价格查询:</label>
    <input type="radio" name="req_price" value="higher" checked>
    <label>升序</label>
    <input type="radio" name="req_price" value="lower">
    <label>降序</label>
    <input type="submit" id="orderBy_price" value="查询">
    <br>
    <label>相较于某元的商品查询:</label>
    <input type="text" name="standard">
    <input type="radio" name="comp_price" value="greater" checked>
    <label>升序</label>
    <input type="radio" name="comp_price" value="less">
    <label>降序</label>
    <input type="submit" id="compOn_price" value="查询">
    <br>
    <label>按照销售查询:</label>
    <input type="radio" name="req_sales" value="higher" checked>
    <label>升序</label>
    <input type="radio" name="req_sales" value="lower">
    <label>降序</label>
    <input type="submit" id="orderBy_sales" value="查询">
    <br>
    <p style="text-align: center">

        <input type="submit" id="cmd_page_first" value="首页">|
        <input type="submit" id="cmd_page_before" value="上一页">|
        <input type="submit" id="cmd_page_next" value="下一页">|
        <input type="submit" id="cmd_page_last" value="尾页">
    </p>
</form>
<hr>
<table width="80%" border="1" align="center">
    <tr>
        <th width="10%">商品id</th>
        <th width="10%">商品名称</th>
        <th width="30%">商品介绍</th>
        <th width="5%">商品价格</th>
        <th width="10%">商品类别</th>
        <th width="5%">商品销量</th>
        <th width="10%">商品产地</th>
        <th width="10%">商家id</th>
        <th width="5%">商家名称</th>
        <th width="5%">商品质量</th>
    </tr>

    <tr>
        <td><%=gid%></td>
        <td><%=gname%></td>
        <td><%=intro%></td>
        <td><%=price%></td>
        <td><%=type%></td>
        <td><%=sales%></td>
        <td><%=good_from%></td>
        <td><%=mid%></td>
        <td></td>
        <td></td>
    </tr>

</table>
</body>
</html>

